# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-universal-require
_pkgname=UNIVERSAL-require
pkgver=0.19
pkgrel=5
pkgdesc='require() modules from a variable.'
arch=('any')
url='http://search.cpan.org/~neilb/UNIVERSAL-require/lib/UNIVERSAL/require.pm'
license=('PerlArtistic')
makedepends=('perl')
source=("http://search.cpan.org/CPAN/authors/id/N/NE/NEILB/$_pkgname-$pkgver.tar.gz")
sha512sums=('065a361a7605aa2827ad14eeecea23a2238df2cc477c73ea2facd475953000d0c6f8773db886333295501e6d2602dd08e2f9a81d77b4f3a4c3926dcc57358cb2')

build() {
  cd "$_pkgname-$pkgver"

  perl Makefile.PL

  make
}

package() {
  cd "$_pkgname-$pkgver"

  install -Dm 644 \
    "$srcdir/UNIVERSAL-require-$pkgver/blib/lib/UNIVERSAL/require.pm" \
    "$pkgdir/usr/lib/perl5/vendor_perl/UNIVERSAL/require.pm"
  install -Dm 644 \
    "$srcdir/UNIVERSAL-require-$pkgver/blib/man3/UNIVERSAL::require.3pm" \
    "$pkgdir/usr/share/man/man3/UNIVERSAL::require.3pm"
}

